package com.zhongying.sys.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;

import com.zhongying.inteceptor.entity.RequestLogEntity;
import com.zhongying.inteceptor.util.RequestLogUtil;
/**
 * 操作日志
 * @author zhanghuan
 *
 */
public interface SysOperateLogDao {

	@Insert("INSERT INTO sys_operate_log set operate_url=#{operateUrl},operate_data=#{operateDataStr},operate_business=#{operateBusiness},operate_desc=#{operateDesc},operate_ip=#{operateIp},operate_user=#{operateUser},operate_time=now()")
	int insert(RequestLogEntity log);
	
	
	@SelectProvider(type = RequestLogUtil.class, method = "listSysOperateLog")
	@Results({ @Result(column = "id", property = "id"), @Result(column = "operate_url", property = "operateUrl"),
			@Result(column = "operate_data", property = "operateData"),
			@Result(column = "operate_business", property = "operateBusiness"),
			@Result(column = "operate_desc", property = "operateDesc"),
			@Result(column = "operate_ip", property = "operateIp"),
			@Result(column = "operate_user", property = "operateUser"),
			@Result(column = "operate_time", property = "operateTime") })
	List<RequestLogEntity> list(String url, String name,Integer s,Integer limit,String start,String end);


	@SelectProvider(type = RequestLogUtil.class, method = "countSysOperateLog")
	Long count(String url, String name,String start,String end);
}
